package collection;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("C:/Users/tedu/IdeaProjects/JSD2211SE/demo.txt");
    File file1=new File("./demo.txt");
    String name=file.getName();
        System.out.println("名字"+name);
        long length=file.length();
        System.out.println(length+"字节");
        boolean cf=file.canWrite();
        boolean c1 =file.canRead();
        System.out.println("可读"+c1);
        System.out.println("可写"+cf);

    }
}
